package com.code;

import java.util.ArrayList;

import com.example.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class DetailShipReceipt extends Activity {
	private ArrayList<String> detail;
	private TextView tvNhapCua, tvDiaChi, tvSDT, tvNhanVien, tvTextNhapCua,
			tvThanhTien;
	private int chooseNhapXuat;
	private Button btnTroVeShipReceipt;
	private String title;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.detailshipreceipt);
		chooseNhapXuat = super.getIntent().getExtras().getInt("chooseNhapXuat");

		tvNhapCua = (TextView) findViewById(R.id.tvNhapCua);
		tvDiaChi = (TextView) findViewById(R.id.tvDiaChi);
		tvSDT = (TextView) findViewById(R.id.tvSDT);
		tvNhanVien = (TextView) findViewById(R.id.tvNhanVien);
		tvTextNhapCua = (TextView) findViewById(R.id.textView1);
		tvThanhTien = (TextView) findViewById(R.id.tvThanhTien);
		btnTroVeShipReceipt = (Button) findViewById(R.id.btnTroVeShipReceipt);

		detail = super.getIntent().getExtras()
				.getStringArrayList("detailshipreceipt");
		tvNhapCua.setText(detail.get(0));
		tvDiaChi.setText(detail.get(1));
		tvSDT.setText(detail.get(2));
		tvNhanVien.setText(detail.get(3));
		tvThanhTien.setText(detail.get(4));
		if (chooseNhapXuat == TK_ChonMau.CHOOSE_XUAT) {
			title = "Chi tiết xuất";
			tvTextNhapCua.setText("Xuất cho : ");
		} else {
			title = "Chi tiết nhập";
			tvTextNhapCua.setText("Nhập Của : ");
		}

		btnTroVeShipReceipt.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				setResult(RESULT_CANCELED);
				finish();
			}
		});
		this.setTitle(title);

	}
}
